package com.aop.proxy;

public class OrderDAOImpl {
    public String addOrder(String name) {
        return "下了"+name+"订单";
    }

    public static void main(String[] args) {
        // 没有实现接口的类的代理
        // 创建目标对象
        OrderDAOImpl impl = new OrderDAOImpl();
        // 创建cglib代理
        OrderDAOImpl cglibProxy = (OrderDAOImpl) new CGLIBProxy().createCGLIBProxy(impl);
        String result =  cglibProxy.addOrder("商品");
        System.out.println(result);
    }
}
